package com.summer_administration.pojo;

import com.fasterxml.jackson.annotation.JsonFormat;
import jakarta.validation.constraints.*;
import lombok.Data;
import java.time.LocalDateTime;

@Data
public class Material {
    private Integer id;

    @NotBlank(message = "物资名称不能为空")
    private String metName;

    @NotNull(message = "物资数量不能为空")
    @Min(value = 1, message = "物资数量至少为1")
    private Integer metNum;

    @NotBlank(message = "物资属性不能为空")
    @Pattern(regexp = "奖品|设备", message = "物资属性必须为奖品或设备")
    private String metAttr;

    @NotNull(message = "剩余数量不能为空")
    @Min(value = 0, message = "剩余数量不能为负数")
    private Integer remainNum;

    private Integer createUser;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;
}
